import {

  locationcity
} from "~/api/commen";
import Cookie from'js-cookie'
export default function ({ $axios, redirect, req, store, route, app }) {
    let storeCache = sessionStorage.getItem("city")
  if(!store.state.navList.city || !storeCache) {
    locationcity().then(res => {
      if (res.id){
          store.commit("navList/SET_CITY", res);
          sessionStorage.setItem('city',JSON.stringify(res))
          Cookie.set('city',res.id );
      }
    })
  }
}
